<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <title>申补单</title>
</head>

<body>
  <div id="app" v-loading.fullscreen.lock="loading">
    <div class="material-supply-order" v-if="menus!==null">
      <el-tabs v-model="activeMenu" class="full-tabs" v-if="menus.length>0">
        <el-tab-pane lazy v-for="menu in menus" :key="menu.name" :label="menu.label" :name="menu.name">
          <component :is="menu.url" class="menu-item"></component>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</body>

<script src="../../myJs/importFile.js"></script>
<script>
  importFile([
    "/vueSystem/components/css/searchBtnView.css",
    "/vueSystem/components/css/promptForm.css",
    "./css/personLiableSetting.css",
    "./css/personLiableShow.css",
    "./css/createSupplyOrder.css",
    "./css/querySupplyOrder.css"
  ], [
    "/vueSystem/i18n/index.js",
    "/vueSystem/components/searchBtnView.js",
    "/vueSystem/components/promptForm.js",
    "/vueSystem/components/tableSelect.js",
    "/vueSystem/js/checkVaildUtil.js",
    "/vueSystem/js/permissionUtil.js",
    "/vueSystem/components/filterSelect.js",
    "/vueSystem/mixins/tablePaginationMixin.js"
  ]);

</script>
<script src="../mixins/supplyOrderMixin.js"></script>
<script src="./personLiableSetting.js"></script>
<script src="./personLiableShow.js"></script>
<script src="./createSupplyOrder.js"></script>
<script src="./querySupplyOrder.js"></script>

<script>
  var app = new Vue({
    el: "#app",
    data: function () {
      return {
        loading: false,
        activeMenu: "",
        menus: null
      };
    },

    created: function () {
      var menus = [{
        label: '创建申补单',
        name: 'createSupplyOrder',
        url: 'create-supply-order',
        authority: 'applyRepairForm.html'
      }, {
        label: '查询申补单',
        name: 'querySupplyOrder',
        url: 'query-supply-order',
        authority: 'queryApplyRepairForm.html'
      }];
      var pageAuthorityList = _.map(menus, 'authority');
      this.loading = true;
      var self = this;
      PermissionUtil.validatePageAuthorityList(pageAuthorityList).then(function (validate) {
        menus = _.filter(menus, function (menu) {
          return validate[menu.authority];
        });

        self.activeMenu = menus[0].name;
        self.menus = menus;
        self.loading = false;
      }).catch(function () {
        self.loading = false;
      });
    },

    components: {
      CreateSupplyOrder: CreateSupplyOrder,
      QuerySupplyOrder: QuerySupplyOrder
    }
  });

</script>
<style>
  .material-supply-order {
    padding-left: 20px;
    height: 100%;
  }

  .material-supply-order .perosn-row td .cell:after {
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
  }

  .material-supply-order .perosn-row td .cell {
    zoom: 1;
  }

  .material-supply-order .perosn-row td .cell>* {
    float: left;
  }

</style>

</html>
